package cn.com.lsy.product.lepao.service.impl;

import cn.com.lsy.product.lepao.model.dao.LpAreaTblMapper;
import cn.com.lsy.product.lepao.model.entities.LpAreaTbl;
import cn.com.lsy.product.lepao.model.entities.LpAreaTblExample;
import cn.com.lsy.product.lepao.service.IAreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AreaService implements IAreaService {

    @Autowired
    LpAreaTblMapper lpAreaTblMapper;

    @Override
    public LpAreaTbl selectAreaInfo(int id) {

        return lpAreaTblMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<LpAreaTbl> selectAreaList(int parentId) {

        LpAreaTblExample example = new LpAreaTblExample();
        example.createCriteria().andParentIdEqualTo(parentId);

        return lpAreaTblMapper.selectByExample(example);
    }
}
